PopupController
Basic controller interface for GUIs that want to implement a popup system. This does not handle interaction handling nor rendering, that needs to be integrated into the screen being built.
There are some helper methods for rendering popups in a predicatable manner. Make sure to call both!
Author
fzzyhmstrs
Since
0.6.7, moved from PopupParentElement originally 0.2.0
See also
Inheritors
Types
Properties
Boolean prevents mouseReleased
from triggering on the Popup or Widget underneath the active popup if it's closed on mouseClicked
getter and setter for the cached element.
A stack for holding popupwidgets while allowing for easy list iteration as needed. For rendering this stack should be traversed in reverse order, which LinkedList makes easy with descendingIterator
Functions
Called by this parent element when it pushes a PopupWidget to its stack. This method should "blur" the focus of the underlying children in this parent element; using blur()
from Screen, for example.
called when a Popup is pushed to this element, after blurring.
Indicates that the overlay has been removed and the parent should return focus to the cached element, if any, in lastSelected
Renders the current open popups in descending order (oldest first/the farthest back) and then pops matrices. This needs to be called with preRender or the game will crash from a non-empty matrix stack.
Pushes the current matrix and moves the content rendering back to make room for the popups. This needs to be called with postRender or the game will crash from a non-empty matrix stack.
Indicates to the parent element to cache it's current focused element. The current focused element should be stored in lastSelected
When called the parent element should reselect a hovered element based on the supplied mouse positions, if it tracks such things
Applies a popup widget to this parent. If null is passed, removes the top (newest) popup instead
Applies a popup widget to this parent. If null is passed, removes the top (newest) popup instead